<%@ page import="project.pojo.Student" %>
<%@ page import="project.pojo.Person" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.Arrays" %>
<%@ page import="java.util.Map" %>
<%@ page import="java.util.HashMap" %><%--
  Created by IntelliJ IDEA.
  User: d11yu
  Date: 2022/4/9
  Time: 16:22
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    Person person = new Person();
    person.setName("A");
    person.setPhone(new String[]{"1234", "2345", "3456"});
    person.setCities(new ArrayList<>(Arrays.asList("北京", "上海", "深圳")));
    Map<String, String> map = new HashMap<>();
    map.put("k1", "v1");
    map.put("k2", "v2");
    map.put("k3", "v3");
    person.setMap(map);
    pageContext.setAttribute("p", person);
%>
输出Person：${p}<br>
输出Person.name：${p.name}<br>
输出Person.phone：${p.phone[0]}<br>
输出Person.cities：${p.cities}<br>
输出Person.cities中的指定元素：${p.cities[0]}<br>
输出Person.cities中的指定元素：${p.cities.get(1)}<br>
输出Person.map：${p.map}<br>
输出Person.map的指定元素：${p.map.get("k2")}<br>
输出Person.map的指定元素：${p.map["k2"]}<br>
</body>
</html>
